package com.moetube.search.pojo;

import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import javax.persistence.Id;
import java.io.Serializable;
import java.util.Date;

@Document(indexName = "videoinfo", type = "docs")
@Data
public class VideoInfo implements Serializable {

    //视频id，同时也是视频编号
    @Id
    @Field(index = true, store = true, type = FieldType.Keyword)
    private Long id;

    //标题
    /*    @Field(index = true, store = true, type = FieldType.Text,analyzer = "ik_smart")*/
    @Field(index = true, store = true, type = FieldType.Text,analyzer = "ik_max_word")
    private String title;

    //文字内容
    @Field(index = true, store = true,type = FieldType.Text)
    private String content;

    //点击数量
    @Field(index = true, store = true, type = FieldType.Long)
    private Long clickCount;

    //播放数量
    @Field(index = true, store = true, type = FieldType.Long)
    private Long playCount;

    //弹幕数量
    @Field(index = true, store = true, type = FieldType.Long)
    private Long barrageCount;

    //点赞数量
    @Field(index = true, store = true, type = FieldType.Long)
    private Long likeCount;

    //投币数量
    @Field(index = true, store = true, type = FieldType.Long)
    private Long insertCoinsCount;

    //收藏数量
    @Field(index = true, store = true, type = FieldType.Long)
    private Long collectCount;

    //转发数量
    @Field(index = true, store = true, type = FieldType.Long)
    private Long transpoundCount;

    //评论数量
    @Field(index = true, store = true, type = FieldType.Long)
    private Long commentCount;

    //上传时间
    @Field(index = true, store = true, type = FieldType.Date)
    private Date uploadTime;

    //视频时长
    @Field(index = true, store = true, type = FieldType.Long)
    private Long videoTime;

    //视频标签(数组)
    @Field(index = true, store = true, type = FieldType.Keyword)
    private String label;

    //审核状态0未审核1审核通过
    @Field(index = true, store = true, type = FieldType.Keyword)
    private Integer audit;

    //视频图片url
    @Field(index = true, store = true, type = FieldType.Text)
    private String image;

    //视频跟新时间
    @Field(index = true, store = true, type = FieldType.Date)
    private Date updateTime;

    //一级分类
    @Field(index = true, store = true, type = FieldType.Integer)
    private Integer category1Id;

    //二级分类
    @Field(index = true, store = true, type = FieldType.Integer)
    private Integer category2Id;

    //一级分类名字
    @Field(index = true, store = true, type = FieldType.Text)
    private String category1Name;

    //二级分类名字
    @Field(index = true, store = true, type = FieldType.Text)
    private String category2Name;

    //上传用户id
    @Field(index = true, store = true, type = FieldType.Keyword)
    private String userId;

    //视频链接
    @Field(index = true, store = true, type = FieldType.Text)
    private String videoUrl;

}
